<?php include "templates/include/header.php" ?>

      <div id="adminHeader">
        <h2>Administration de la page d'Accueil</h2>
        <p>Vous etes connect&eacute; en tant que <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Se D&eacute;connecter</a></p>
      </div>

      <h1><?php echo $results['pageTitle']?></h1>

      <form action="admin.php?action=<?php echo $results['formAction']?>" method="post">
        <input type="hidden" name="homeId" value="<?php echo $results['edit']->id ?>"/>

<?php if ( isset( $results['errorMessage'] ) ) { ?>
        <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>
<?php } ?>
  <table align="center" width="90%" cellpadding="5px" cellspacing="0" border="0">
    <tr height="320px">
      <td valign="middle" align="justify">
        <label for="content">Contenu de l'Article</label>
        </br>
        <textarea name="content" id="content" placeholder="The HTML content of the article" maxlength="100000" style="height: 230px; width: 100%;"><?php echo htmlspecialchars( $results['edit']->content )?></textarea>
      </td>
    </tr>
  </table>
        <div class="buttons">
          <input type="submit" name="saveChanges" value="Enregister" />
          <input type="submit" formnovalidate name="cancel" value="Annuler" />
        </div>

      </form>

<?php if ( $results['edit']->id ) { ?>
      <p><a href="admin.php?action=deleteHome&amp;homeId=<?php echo $results['edit']->id ?>" onclick="return confirm('Delete This Article?')">Supprimer cet Article</a></p>
<?php } ?>

<?php include "templates/include/footer.php" ?>
